package com.wxb.plugin.core.gen;

import com.intellij.psi.PsiClass;
import com.wxb.plugin.core.parser.TextParser;
import com.wxb.plugin.core.parser.URLParser;

import java.util.ArrayList;
import java.util.List;

import static com.wxb.plugin.core.gen.QualifyClassName.Hidden;

/**
 * @author wxb
 * @createTime 2025/2/27 15:55
 */
public class ControllerApiInfo {
    String note;
    boolean hide;
    String className;
    String prefixPath;
    String author;
    List<MethodApiInfo> methodApiInfos;

    public ControllerApiInfo(PsiClass aClass) {
        className = TextParser.getClassName(aClass);
        className = StringUtil.isBlank(className) ? aClass.getName() : className;
        note = TextParser.getClassNote(aClass);
        note = StringUtil.isBlank(note) ? className : note;
        prefixPath = URLParser.getClassUrl(aClass);
        methodApiInfos = new ArrayList<>();
        hide = URLParser.hide(aClass.getAnnotation(Hidden));
        author = "";
    }


}
